{% extends 'system_template/public/pop_up_main.html' %}
{% block content %}
    <div style="padding: 10px;">
        <blockquote class="layui-elem-quote layui-quote-nm">
            1.购买授权后可自己提供建设网站，修改，二次开发的服务，但禁止发布或传播本程序及本程序的任何形态！禁止出售本程序及本程序的任何形态。说白了就是不能将程序出售或传播，否则侵权。
        </blockquote>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <a class="layui-btn layui-btn-normal" data-id="1" data-color="layui-bg-blue">生成首页</a>
            <a class="layui-btn layui-btn-warm" data-id="2" data-color="layui-bg-orange">生成列表</a>
            <a class="layui-btn" data-id="3">生成内容</a>
            <a class="layui-btn layui-btn-danger" data-id="4" data-color="layui-bg-red">清除所有</a>
        </div>
    </div>



{% endblock %}
{% block footer %}
    <script>
        $('.layui-input-block>a').on('click', function (ele) {
            var text = $(this).text();
            var type = $(this).attr('data-id');
            //      var color = $(this).attr('data-color');
            //      var div = '"<div style=\"padding: 10px;\" data-type=\"'+type+'\">\n" '+
            //         "        <div class=\"layui-progress\" lay-showPercent=\"no\">\n" +
            //         '"            <div class=\"layui-progress-bar '+color+'\" lay-percent=\"30%\"></div>\n"' +
            //         "        </div>\n" +
            //         "    </div>";
            layer.confirm('您确定' + text + '么?', {
                btn: ['确定', '取消'],
                btnAlign: 'c'
                , yes: function (index, layero) {
                    $.ajax({
                        data: {"type": type},
                        dataType: 'json',
                        type: "POST",
                        async : false,
                        success: function (response) {
                            if (response.status === 0) {
                                layer.closeAll('loading');
                                layer.msg(text + '添加任务成功', {icon: 1, time: 2000});
                            } else {
                                layer.closeAll('loading');
                                layer.msg(text + '添加任务失败: ' + response.msg, {icon: 2, time: 3000});
                            }
                        }, error: function (error) {
                            layer.msg(text + '添加任务异常!', {icon: 7, time: 2000});
                            layer.closeAll('loading');
                        }
                    });
                }, btn2: function (index, layero) {
                    layer.msg('取消任务成功！', {icon: 1, time: 2000});
                }
            })
        })
    </script>
{% endblock %}